package com.linchuan.concurrency;

public class JoinDemo {
  public static void main(String[] args) throws InterruptedException {
    Thread runThread =
        new Thread(
            () -> {
              while (true) {
                try {
                  Thread.sleep(1000);
                  System.out.println("Running...");
                } catch (InterruptedException e) {
                  e.printStackTrace();
                }
              }
            });
    runThread.start();
    runThread.join(5000);
  }
}
